package com.pan.test.socket.example06;

import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

public class Client {
    public static void main(String[] args) throws IOException, InterruptedException {
        InetAddress inetAddress = InetAddress.getByName("192.168.31.43");
        Socket[] sockets = new Socket[3];
        for (int i = 0; i < 3; i++) {
            sockets[i] = new Socket(inetAddress,11451);
            System.out.println(sockets[i].isConnected()?"连接成功":"连接失败");
        }
        Thread.sleep(10000);
    }
}
